<?php

namespace App\Models;

use App\Models\Device;
use App\Models\Sns;
use App\Models\DeviceGroupTask;
use Illuminate\Database\Eloquent\Model;

class DeviceGroup extends Model
{
  protected $fillable = ['name', 'desc'];

  public function devices()
  {
    return $this->hasMany(Device::class);
  }

  public function sns()
  {
    return $this->belongsToMany(Sns::class);
  }

  public function tasks()
  {
    return $this->hasMany(DeviceGroupTask::class);
  }

  public function sentences()
  {
      return $this->hasMany(DeviceGroupSentence::class);
  }
  public function qq()
  {
      return $this->hasMany(Qq::class);
  }
  public function deviceGroupAdd()
  {
      return $this->hasOne(DeviceGroupAdd::class);
  }
}
